This invention relates generally to data storage in a computer system. More particularly, it relates to a locking method and system for a versioned object.
Distributed computer environments in which a plurality of processors are interconnected in a network are becoming increasingly prevalent. In these environments, several users may wish to simultaneously access and potentially update the same versioned object. A versioned object is an object with multiple copies for multiple users. Version control is one of the more important functions in various data intensive application domains such as software engineering, CAD/CAM systems and office information systems dealing with compound documents. Version control assures that a single version of the data is available to all users. Further, users in these environments need to experiment with multiple versions of an object.
Traditional Read/Write locking schemes do not distinguish between parent or child objects nor deal with partial objects. Users have to lock/unlock the whole object. Further, if the lock request failed because someone has locked the object, the user has to retry the lock request again and again until the object is available.
Commonly assigned U.S. Pat. No. 5,175,851 to Johnson et al. teaches a method by which a plurality of users can share access to a data file through the use of tokens. A plurality of users can have read tokens to a portion of the data, however, when one user acquires a read/write token all of the read tokens held by other users are revoked. The user with the read/write token controls a physical page of storage used for the file, rather than only the logical portion of the file which the user wishes to modify.
The advantage of allowing programmers to checkout part of the objects is that it allows more users to work on the same object. However, it is commonly recognized as a difficult task to merge the work from multiple users on the same object together. Optimistic concurrency control allows users to checkout objects freely. However, if there are multiple users update the same object, only one user's update will be accepted. All other updates are aborted.
This application proposes an improved locking scheme for a versioned object.